import matplotlib.pyplot as plt
import random

def plot_path(the_map,path,colour = 'g'):
    '''path is a list of links.
    Don't forget plt.show()'''
    points = the_map.junctions
    for link in path:
        plt.plot([points[link.source].lon,points[link.target].lon],
                     [points[link.source].lat,points[link.target].lat],
                 colour)
    plt.axis('equal')

def plot_israel(israel_map):
    "Plots random roads in Israel. Don't forget plt.show()"
    links = [random.choice(j.links) for j in
             random.sample(israel_map.junctions,10000) if len(j.links)>0]
    plot_path(israel_map,links,'c')

